<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>easyui calendar demo</title>
<link rel="stylesheet" type="text/css" href="../js/easyui/themes/default/easyui.css" id="swicth-style">
<link rel="stylesheet" type="text/css" href="../js/easyui/themes/icon.css">

<script type="text/javascript" src="../js/jquery-1.9.0.js"></script>
<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../js/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../js/easyui/easyui.dateformat.js"></script>
<script type="text/javascript">
$(function(){
	$("#cc2").datebox({
		required:true,
		//disabled:true,
		formatter: function(date){
				var y = date.getFullYear();
				var m = date.getMonth()+1;
				var d = date.getDate();
				return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
		},
		parser: function(s){
			if (!s) return new Date();
			var ss = (s.split('-'));
			var y = parseInt(ss[0],10);
			var m = parseInt(ss[1],10);
			var d = parseInt(ss[2],10);
			if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
				return new Date(y,m-1,d);
			} else {
				return new Date();
			}
		}
	});
});
</script>
</head>
<body>
	<input id="cc" class="easyui-calendar easyui-datebox" data-options="formatter:dateFormatter1,parser:dateParser1" style="width:150px;height:25px;"/>
	
	<input id="cc2" style="width:150px;height:25px;"/>
	
</body>
</html>